package com.hsmw.schedule.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;

import com.hsmw.common.base.BaseMapper;
import com.hsmw.domain.*;
import com.hsmw.domain.vo.*;
import com.hsmw.domain.vo.DriverInfoVO;
import com.hsmw.schedule.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author WD
 * @since 2021-02-02
 */
@Repository
public interface HsmwOrderMapper extends BaseMapper<HsmwOrder> {

    long getPmAmount(HashMap param);

    OrderCountResultVO getOrderInfoCount(HashMap param);

	IPage<HsmwOrder> selectOrderPage(IPage page, @Param("hsmwOrder") HsmwOrder hsmwOrder);

    List<ForemanCountVO> getFormanCountInfo(HashMap param);

    List<ContructionPosionAndbatchPlantVO> queryRecentsAddresslist(HashMap param);

    List<ForcemanCurrentOrderDTO> selectOrderListByCreateUser(HashMap param);

    List<PMGoingOrderVO> selectOrderProcessByOrderId(HashMap param);


    List<PMOrderCountVO> selectForemanOrderListByParam(HashMap param);

    List<ContructionPosionAndbatchPlantVO> queryRecentsPlantlist(HashMap param);

    //查询首页默认的标号统计
    List<ConcrateCountDTO> concreteDefaultCountInfo(HashMap param);

    //查询月级别的 方量统计
    List<ConcrateCountDTO> concreteMonthCountInfo(HashMap param);


    //查询方量标号 总和
    List<ForemanCountVO> concreteAllCountInfo(HashMap param);


    List<HsmwOrderVehicleRequest> getUnCompletePublish();

    List<PMGoingOrderVO> selectOrderProcessByVehicleId(HashMap param);

    List<HsmwOrder> selectOrderByVehicleId(HashMap param);

    IPage<HsmwOrder> findOrderListByStatus(IPage page, @Param("hsmwOrder") HsmwOrder hsmwOrder);

    List<OrderAndVehicleVo> findWaitVehicleInfoByOrderSn(String orderSn);

    List<CountVO> selctVehicleCount(@Param("vehicleType") String vehicleType, @Param("vehicleModel") String vehicleModel);

    Long selectSumCount(@Param("vehicleType")String vehicleType, @Param("vehicleModel")String vehicleModel);

    List<HandOrderDriverDetailInfoVO> findDriverInfoByOrderSn(@Param("orderSn")String orderSn,@Param("vehicleModel")String vehicleModel,@Param("vehicleType")String vehicleType);

    List<DriverInfo> findIdleVehiclesInfo( @Param("vehicleModel")String vehicleModel,@Param("vehicleType")String vehicleType);

    Long findOdvList(@Param("orderSn")String orderSn,@Param("vehicleModel")String vehicleModel,@Param("vehicleType")String vehicleType);

    List<HandOrderDriverDetailInfoVO> findDriverRequestInfoByOrderSn(@Param("orderSn")String orderSn,@Param("vehicleModel")String vehicleModel,@Param("vehicleType")String vehicleType);

    List<IdleVehicleVo> retailFindOrderStatusList(@Param("param") String param,@Param("companyId") String companyId,@Param("id") String id);

    List<BizOrderDTO>  getHsmwOrderPageByStatus(HashMap param);

    OrderTotalInfoVO  getHsmwOrderCountByStatus(HashMap param);

    List<BizOrderDTO>  getConceledOrderPageByStatus(HashMap param);

    OrderTotalInfoVO  getCanceledOrderCountByStatus(HashMap param);

    List<BizOrderDTO>  getCompleteOrderPageByStatus(HashMap param);

    OrderTotalInfoVO  getCompleteOrderCountByStatus(HashMap param);



    List<BizOrderDTO>  getHsmwOrderPageByParam(HashMap param);





    List<IdleVehicleVo> foreManFindOrderStatusList(@Param("param")String param,@Param("id") String id);

    IdleVehicleVo findOrderDetailsByOrderId(String orderId);

    List<OutLeasingOrderVO> getOutLeasingOrderList(HashMap param);

    List<HomeVolume> findForeManVolumeWeek();

    List<HomeVolume> findForeManVolumeMonth();

    List<OrderAndItemVO> findConcreteOrderList(@Param("param") String param,@Param("id") String id);

    OrderAndItemVO findConcreteOrderListById(String id);


    public List<RetailerAdressInfoVO> getRetailerRecentAdress(String userId);

    IdleVehicleVo findOrderinfoByOrderId(String orderId);

    List<HsmwConcretePlantInfo> getAviablePlantInfos(String itemId);

    List<HsmwOrder> expireConcreteOrders();

    Double selectItemInfoByItemId(HashMap param);

    List<DriverCountVO> findUserDriverListBYVehicleId(String vehicleId);

    List<DriverCountVO> findUserDriverListByParam(HashMap param);

    List<DriverCountVO> findDriverRecordByParam(HashMap param);


    List<DriverCountVO> findUserDriverListByOrderId(String orderId);

    void saveOrderVo(BeanUtilsOrderVO beanUtilsOrderVO);

    List<HsmwOrder> getForemanList();

    IPage<HtnOrderInfoVO> selectOrderInfoListByParam(IPage page,  @Param("param")  String param,  @Param("companyId") String companyId, @Param("id") String id);

    Integer selectAvaliableCount(HashMap param);

    HtnPumpOrderDetailVo selectOrderDetailByRelationId(HashMap param);

    List<HsmwConstructionPosition> selectPositionsByOrderId(HashMap param);

    List<DriverInfoVO> findDriverListByehicleId(HashMap param);



    List<HtnSettleOrderDetailVo> selectSettleOrderListByParam(HashMap param);

    HtnSettleOrderCountVo selectFrozenCountByParam(HashMap param);


    int selectGoingOrderCount(HashMap params);


    IPage<HtnPumpOrderDetailVo> selectConcreteOrderInfoListByParam(IPage page,  @Param("param")  String param,  @Param("companyId") String companyId, @Param("id") String id);

    HtnPumpOrderDetailVo selectConcreteOrderDetail(String requestId);

    boolean updateOrderWorkStatusById(String id);
}
